package com.wkr.order;

import com.dianping.cat.Cat;
import com.dianping.cat.message.Message;
import com.wkr.order.config.LBConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.cloud.netflix.ribbon.RibbonClients;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;

@EnableDiscoveryClient
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
@EnableFeignClients
@RibbonClients(defaultConfiguration = LBConfig.class)
//@ComponentScan(value = {"com.wkr.**"}
//		,excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE,value = {LBConfig.class}))
// 需要保证自定义负载均衡规则不被Spring扫描到，扫描到则共享这个配置
public class ConsumerApplication {

	public static void main(String[] args) {
		SpringApplication.run(ConsumerApplication.class, args);
		Cat.logHeartbeat("logHeartbeat", "logHeartbeat", Message.SUCCESS, null);
	}

}
